/*
 * Copyright 2015 CPE Lyon - IRC 2013/2016 - Cours de programmation réseau - Groupe H
 *
 * This file is part of BOTT.
 *
 * BOTT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * BOTT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with BOTT. If not, see http://www.gnu.org/licenses/.
 */

/*
 * Protocole BIMP.
 *
 * Définition des données du protocole.
 */

#ifndef PROTOCOLE_H
#define PROTOCOLE_H

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>


#define BUFFER 500
#define SERVER_PORT 8080
#define MAX 99

/* Définition de la structure des messages */

typedef struct bimp_msg bimp_msg;
struct bimp_msg {
    int16_t idCommand;  // Big endian
    int16_t idUser;     // Big endian
    int16_t idChat;     // Big endian
    char data[BUFFER];
};

/* Liste des ID de commandes pour le client */

extern int16_t clientCommands[8];

/* Liste des ID de commandes pour le serveur */

extern int16_t serverCommands[12];

#endif